package com.lanou.dllo.soccernews.bean.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.dllo.soccernews.bean.greendao.RecommendEntity;
import com.lanou.dllo.soccernews.bean.greendao.ArticlesEntity;
import com.lanou.dllo.soccernews.bean.greendao.CollectionBeanArticlesEntity;
import com.lanou.dllo.soccernews.bean.greendao.DeepBeanArticlesEntity;
import com.lanou.dllo.soccernews.bean.greendao.Users;

import com.lanou.dllo.soccernews.bean.greendao.RecommendEntityDao;
import com.lanou.dllo.soccernews.bean.greendao.ArticlesEntityDao;
import com.lanou.dllo.soccernews.bean.greendao.CollectionBeanArticlesEntityDao;
import com.lanou.dllo.soccernews.bean.greendao.DeepBeanArticlesEntityDao;
import com.lanou.dllo.soccernews.bean.greendao.UsersDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig recommendEntityDaoConfig;
    private final DaoConfig articlesEntityDaoConfig;
    private final DaoConfig collectionBeanArticlesEntityDaoConfig;
    private final DaoConfig deepBeanArticlesEntityDaoConfig;
    private final DaoConfig usersDaoConfig;

    private final RecommendEntityDao recommendEntityDao;
    private final ArticlesEntityDao articlesEntityDao;
    private final CollectionBeanArticlesEntityDao collectionBeanArticlesEntityDao;
    private final DeepBeanArticlesEntityDao deepBeanArticlesEntityDao;
    private final UsersDao usersDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        recommendEntityDaoConfig = daoConfigMap.get(RecommendEntityDao.class).clone();
        recommendEntityDaoConfig.initIdentityScope(type);

        articlesEntityDaoConfig = daoConfigMap.get(ArticlesEntityDao.class).clone();
        articlesEntityDaoConfig.initIdentityScope(type);

        collectionBeanArticlesEntityDaoConfig = daoConfigMap.get(CollectionBeanArticlesEntityDao.class).clone();
        collectionBeanArticlesEntityDaoConfig.initIdentityScope(type);

        deepBeanArticlesEntityDaoConfig = daoConfigMap.get(DeepBeanArticlesEntityDao.class).clone();
        deepBeanArticlesEntityDaoConfig.initIdentityScope(type);

        usersDaoConfig = daoConfigMap.get(UsersDao.class).clone();
        usersDaoConfig.initIdentityScope(type);

        recommendEntityDao = new RecommendEntityDao(recommendEntityDaoConfig, this);
        articlesEntityDao = new ArticlesEntityDao(articlesEntityDaoConfig, this);
        collectionBeanArticlesEntityDao = new CollectionBeanArticlesEntityDao(collectionBeanArticlesEntityDaoConfig, this);
        deepBeanArticlesEntityDao = new DeepBeanArticlesEntityDao(deepBeanArticlesEntityDaoConfig, this);
        usersDao = new UsersDao(usersDaoConfig, this);

        registerDao(RecommendEntity.class, recommendEntityDao);
        registerDao(ArticlesEntity.class, articlesEntityDao);
        registerDao(CollectionBeanArticlesEntity.class, collectionBeanArticlesEntityDao);
        registerDao(DeepBeanArticlesEntity.class, deepBeanArticlesEntityDao);
        registerDao(Users.class, usersDao);
    }
    
    public void clear() {
        recommendEntityDaoConfig.getIdentityScope().clear();
        articlesEntityDaoConfig.getIdentityScope().clear();
        collectionBeanArticlesEntityDaoConfig.getIdentityScope().clear();
        deepBeanArticlesEntityDaoConfig.getIdentityScope().clear();
        usersDaoConfig.getIdentityScope().clear();
    }

    public RecommendEntityDao getRecommendEntityDao() {
        return recommendEntityDao;
    }

    public ArticlesEntityDao getArticlesEntityDao() {
        return articlesEntityDao;
    }

    public CollectionBeanArticlesEntityDao getCollectionBeanArticlesEntityDao() {
        return collectionBeanArticlesEntityDao;
    }

    public DeepBeanArticlesEntityDao getDeepBeanArticlesEntityDao() {
        return deepBeanArticlesEntityDao;
    }

    public UsersDao getUsersDao() {
        return usersDao;
    }

}
